package com.xyf.sys.mapper;

import com.xyf.sys.domain.Order;
import com.xyf.sys.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface OrderMapper {
    int deleteByPrimaryKey(String id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    List<OrderVo> selectList(OrderListRequestVo requestVo);

    List<OrderVo> selectFactoryOrderList(OrderListRequestVo requestVo);

    Order selectByOutTradeNo(@Param("outTradeNo") String outTradeNo);

    Order selectByTransactionId(@Param("transactionId") String transactionId);

    Order selectByOrderCode(@Param("orderCode") String orderCode);

    Order selectByOutRefundNo(@Param("outRefundNo") String outRefundNo);

    List<OrderPaymentSummary> selectOrderPaymentList(@Param("startDate") String startDate,
                                                     @Param("endDate") String endDate,
                                                     @Param("userId") String userId,
                                                     @Param("deptId") Long deptId,
                                                     @Param("checkType") Integer checkType);

    List<OrderPayment> selectOrderPaymentDetailList(@Param("startDate") String startDate,
                                                    @Param("endDate") String endDate,
                                                    @Param("type") Integer type,
                                                    @Param("userId") String userId,
                                                    @Param("deptId") Long deptId,
                                                    @Param("checkType") Integer checkType);

    OrderBill selectByWaybillId(@Param("waybillId") String waybillId);

    Integer countOrder(@Param("date") String date);

    List<Order> selectNonLogisticsOrderList(@Param("keyword") String keyword);

    List<OrderVo> selectGoodsList(OrderListRequestVo requestVo);

    List<Order> selectAll();

    int updateDept(Order order);

    List<OrderVo> selectGroupLeaderOrder(OrderListRequestVo requestVo);

    List<OrderPayment> selectGroupLeaderList2(@Param("userId") String userId, @Param("orderStatus") String orderStatus, @Param("startDate") String startDate, @Param("endDate")  String endDate, @Param("delFlag") Integer delFlag);
}